package com.pxxy.app_main;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;

import com.pxxy.lib_common.base.BaseActivity;

public class WelcomeActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //隐藏状态栏
        setState(false);
        super.onCreate(savedInstanceState);

        //延迟进入HomeActivity
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(WelcomeActivity.this,HomeActivity.class));
                //销毁欢迎界面
                closeActivity();
            }
        },1000);
    }

    @Override
    public int initLayout() {
        return R.layout.activity_welcome;
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK){
            //禁止返回
            return false;
        }
        return super.onKeyDown(keyCode, event);

    }
}
